﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RelationExpertSystem.Relation
{
    public class Daughter_In_Law : RelationBase
    {
        private static Daughter_In_Law _singleton = new Daughter_In_Law();
        public static Daughter_In_Law Instance
        {
            get { return _singleton; }
        }

        private Daughter_In_Law() { }

        public override bool IsRelated(Person a, Person b)
        {
            // b is a's Daughter_In_Law IFF b is female and b is a's child in law
            return b.Sex == Sex.Female && a.KnownRelation(Child_In_Law.Instance, b);
        }

        public override IEnumerable<IRelation> GetDependencies()
        {
            return new HashSet<IRelation>(new IRelation[] { Child_In_Law.Instance });
        }
    }
}
